package com.mmd.admin.model.pojo.request;

import com.mmd.base.annotation.valid.group.ValidGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

@Data
@ApiModel("礼物新增编辑参数")
public class GiftAddOrEditParam  {

    @ApiModelProperty("礼物id")
    private Long id;

    @ApiModelProperty(value = "礼物名称")
    @NotBlank(message = "礼物名称不能为空")
    @Length(max = 15,message = "礼物名称最大字数不能超过15字",groups = {ValidGroup.Insert.class,ValidGroup.Update.class})
    private String name;

    @ApiModelProperty(value = "价格")
    @DecimalMin(value = "0.01",message = "礼物价格最低0.01",groups = {ValidGroup.Insert.class,ValidGroup.Update.class})
    @NotNull(message = "礼物价格不能为空")
    private BigDecimal price;

    @ApiModelProperty(value = "封面图url")
    @NotBlank(message = "封面图不能为空",groups = {ValidGroup.Insert.class,ValidGroup.Update.class})
    private String coverImgUrl;

    @ApiModelProperty(value = "特效url")
//    @NotBlank(message = "特效不能为空",groups = {ValidGroup.Insert.class,ValidGroup.Update.class})
    private String animationUrl;

    @ApiModelProperty(value = "内容介绍")
    private String content;

    @NotNull(message = "特效时长不能为空",groups = {ValidGroup.Insert.class,ValidGroup.Update.class})
    @ApiModelProperty("时长/ms")
    private Integer duration;

    @ApiModelProperty("苹果价格")
    @DecimalMin(value = "0.01",message = "苹果价格最低0.01",groups = {ValidGroup.Insert.class,ValidGroup.Update.class})
    @NotNull(message = "苹果价格不能为空")
    private BigDecimal applePrice;
}
